# -*- mode: python ; coding: utf-8 -*-
import sys
import os

block_cipher = None

# 获取项目根目录
ROOT_PATH = r'/Users/tenney/git/tools/Notifier'

a = Analysis(
    [os.path.join(ROOT_PATH, 'main.py')],  # 使用完整路径
    pathex=[ROOT_PATH],
    binaries=[],
    datas=[(os.path.join(ROOT_PATH, 'ws_notifier', 'gui', 'assets', '*'), 
            os.path.join('ws_notifier', 'gui', 'assets'))],
    hiddenimports=[
        'websockets.legacy.client',
        'websockets.legacy.server',
        'websockets.legacy.protocol',
        'PIL._tkinter_finder',
        'pystray._win32',
        'win32gui',
        'win32con',
        'win32api',
    ],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[
        'tkinter',
        'unittest',
        'email',
        'http',
        'xml',
        'html',
        'pydoc',
    ],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False,
)

pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.zipfiles,
    a.datas,
    [],
    name='WS Notifier',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=False,
    disable_windowed_traceback=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
    icon=os.path.join(ROOT_PATH, 'ws_notifier', 'gui', 'assets', 'icon.ico'),
)
